package sample.stock;

import android.app.TabActivity;
import android.content.Intent;
import android.os.Bundle;
import android.widget.TabHost;
import android.widget.TabHost.TabSpec;

public class StockApp extends TabActivity{
	@Override
	public void onCreate(Bundle savedInstanceState) {
	super.onCreate(savedInstanceState);
	setContentView(R.layout.stockapp);

	/** TabHost will have Tabs */
	TabHost tabHost = (TabHost)findViewById(android.R.id.tabhost);

	/** TabSpec used to create a new tab.
	* By using TabSpec only we can able to setContent to the tab.
	* By using TabSpec setIndicator() we can set name to tab. */

	/** tid1 is firstTabSpec Id. Its used to access outside. */
	TabSpec firstTabSpec = tabHost.newTabSpec("tid1");
	TabSpec secondTabSpec = tabHost.newTabSpec("tid2");
	TabSpec thirdTabSpec = tabHost.newTabSpec("tid3");

	/** TabSpec setIndicator() is used to set name for the tab. */
	/** TabSpec setContent() is used to set content for a particular tab. */
	firstTabSpec.setIndicator("VNese Stocks").setContent(new Intent(this,StockVN.class));
	secondTabSpec.setIndicator("Yahoo!Finance").setContent(new Intent(this,StockYahoo.class));
	thirdTabSpec.setIndicator("EOD Data").setContent(new Intent(this,EODData.class));

	/** Add tabSpec to the TabHost to display. */
	tabHost.addTab(firstTabSpec);
	tabHost.addTab(secondTabSpec);
	tabHost.addTab(thirdTabSpec);
	}
}
